<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>doc/man/mcedit.1.in</title>
<meta name='robots' content='noindex,nofollow' />
<meta name='generator' content='GLOBAL-6.5.7' />
<meta http-equiv='Content-Style-Type' content='text/css' />
<link rel='stylesheet' type='text/css' href='../style.css' />
</head>
<body>
<!-- beginning of fixed guide -->
<div id='guide'><ul>
<li><a href='#TOP'><img class='icon' src='../icons/first.png' alt='[^]' /></a></li>
<li><a href='#BOTTOM'><img class='icon' src='../icons/last.png' alt='[v]' /></a></li>
<li><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a></li>
<li><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a></li>
<li><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a></li>
<li><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a></li>
<li class='standout'><span><a href='../files/doc.html'>doc</a>/<a href='../files/doc--man.html'>man</a>/mcedit.1.in</span></li>
</ul></div>
<!-- end of fixed guide -->
<a id='TOP' name='TOP'></a><h2 class='header'><a href='../mains.html'>root</a>/<a href='../files/doc.html'>doc</a>/<a href='../files/doc--man.html'>man</a>/mcedit.1.in</h2>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><img class='icon' src='../icons/n_first.png' alt='[first]' /><img class='icon' src='../icons/n_last.png' alt='[last]' /><img class='icon' src='../icons/n_top.png' alt='[top]' /><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+1 doc/man/mcedit.1.in'  /> */</em>
<hr />
<pre>
<a id='L1' name='L1'></a>.TH MCEDIT 1 "%DATE_OF_MAN_PAGE%" "MC Version %DISTR_VERSION%" "GNU Midnight Commander"
<a id='L2' name='L2'></a>.SH NAME
<a id='L3' name='L3'></a>mcedit \- Internal file editor of GNU Midnight Commander.
<a id='L4' name='L4'></a>.SH SYNOPSIS
<a id='L5' name='L5'></a>.B mcedit
<a id='L6' name='L6'></a>[\-bcCdfhstVx?] [+lineno] [file1] [file2] ...
<a id='L7' name='L7'></a>.PP
<a id='L8' name='L8'></a>.B mcedit
<a id='L9' name='L9'></a>[\-bcCdfhstVx?] file1:lineno[:] file2:lineno[:] ...
<a id='L10' name='L10'></a>.SH DESCRIPTION
<a id='L11' name='L11'></a>.LP
<a id='L12' name='L12'></a>mcedit is a link to
<a id='L13' name='L13'></a>.BR mc ,
<a id='L14' name='L14'></a>the main GNU Midnight Commander executable. Executing GNU Midnight Commander
<a id='L15' name='L15'></a>under this name runs the internal editor and opens files
<a id='L16' name='L16'></a>specified on the command line. The editor is based on the terminal version of
<a id='L17' name='L17'></a>.B cooledit
<a id='L18' name='L18'></a>\- standalone editor for X Window System.
<a id='L19' name='L19'></a>.SH OPTIONS
<a id='L20' name='L20'></a>.TP
<a id='L21' name='L21'></a>.I "+lineno"
<a id='L22' name='L22'></a>Go to the line specified by number (do not put a space between the
<a id='L23' name='L23'></a>.I "+"
<a id='L24' name='L24'></a>sign and the number). Several line numbers are allowed but only the last one
<a id='L25' name='L25'></a>will be used, and it will be applied to the first file only.
<a id='L26' name='L26'></a>.TP
<a id='L27' name='L27'></a>.I "\-b"
<a id='L28' name='L28'></a>Force black and white display.
<a id='L29' name='L29'></a>.TP
<a id='L30' name='L30'></a>.I "\-c"
<a id='L31' name='L31'></a>Force ANSI color mode on terminals that don't seem to have color
<a id='L32' name='L32'></a>support.
<a id='L33' name='L33'></a>.TP
<a id='L34' name='L34'></a>.I "\-C &lt;keyword&gt;=&lt;fgcolor&gt;,&lt;bgcolor&gt;,&lt;attributes&gt;:&lt;keyword&gt;= ..."
<a id='L35' name='L35'></a>Specify a different color set.  See the
<a id='L36' name='L36'></a>.B Colors
<a id='L37' name='L37'></a>section in mc(1) for more information.
<a id='L38' name='L38'></a>.TP
<a id='L39' name='L39'></a>.I "\-d"
<a id='L40' name='L40'></a>Disable mouse support.
<a id='L41' name='L41'></a>.TP
<a id='L42' name='L42'></a>.I "\-f"
<a id='L43' name='L43'></a>Display the compiled\-in search path for GNU Midnight Commander data
<a id='L44' name='L44'></a>files.
<a id='L45' name='L45'></a>.TP
<a id='L46' name='L46'></a>.I "\-t"
<a id='L47' name='L47'></a>Force using termcap database instead of terminfo.  This option is only
<a id='L48' name='L48'></a>applicable if GNU Midnight Commander was compiled with S\-Lang library
<a id='L49' name='L49'></a>with terminfo support.
<a id='L50' name='L50'></a>.TP
<a id='L51' name='L51'></a>.I "\-V"
<a id='L52' name='L52'></a>Display the version of the program.
<a id='L53' name='L53'></a>.TP
<a id='L54' name='L54'></a>.I "\-x"
<a id='L55' name='L55'></a>Force xterm mode.  Used when running on xterm\-capable terminals (two
<a id='L56' name='L56'></a>screen modes, and able to send mouse escape sequences).
<a id='L57' name='L57'></a>.SH FEATURES
<a id='L58' name='L58'></a>The internal file editor is a full\-featured windowed editor.  It can
<a id='L59' name='L59'></a>edit several files at the same time. Maximum size of each file is 64
<a id='L60' name='L60'></a>megabytes. It is possible to edit binary files. The features it presently
<a id='L61' name='L61'></a>supports are: block copy, move, delete, cut, paste; key for key undo;
<a id='L62' name='L62'></a>pull\-down menus; file insertion; macro commands; regular expression
<a id='L63' name='L63'></a>search and replace; shift\-arrow text highlighting (if supported by
<a id='L64' name='L64'></a>the terminal); insert\-overwrite toggle; autoindent; tunable tab size;
<a id='L65' name='L65'></a>syntax highlighting for various file types; and an option to pipe text
<a id='L66' name='L66'></a>blocks through shell commands like indent and ispell.
<a id='L67' name='L67'></a>.PP
<a id='L68' name='L68'></a>Each file is opened in its own window in full\-screen mode. Window control
<a id='L69' name='L69'></a>in mcedit is similar to the window control in other multi\-window program:
<a id='L70' name='L70'></a>double click on window title maximizes the window to full\-screen or restores
<a id='L71' name='L71'></a>window size and position; left\-click on window title and mouse drag moves
<a id='L72' name='L72'></a>the window in editor area; left\-click on low\-right frame corner and mouse drag
<a id='L73' name='L73'></a>resizes the window. These actions can be made using "Window" menu.
<a id='L74' name='L74'></a>.SH KEYS
<a id='L75' name='L75'></a>The editor is easy to use and can be used without learning.  The
<a id='L76' name='L76'></a>pull\-down menu is invoked by pressing F9.  You can learn other keys from
<a id='L77' name='L77'></a>the menu and from the button bar labels.
<a id='L78' name='L78'></a>.PP
<a id='L79' name='L79'></a>In addition to that, Shift combined with arrows does text highlighting
<a id='L80' name='L80'></a>(if supported by the terminal):
<a id='L81' name='L81'></a>.B Ctrl\-Ins
<a id='L82' name='L82'></a>copies to the file
<a id='L83' name='L83'></a>.BR ~/.cache/mc/mcedit/mcedit.clip ,
<a id='L84' name='L84'></a>.B Shift\-Ins
<a id='L85' name='L85'></a>pastes from
<a id='L86' name='L86'></a>.BR ~/.cache/mc/mcedit/mcedit.clip ,
<a id='L87' name='L87'></a>.B Shift\-Del
<a id='L88' name='L88'></a>cuts to
<a id='L89' name='L89'></a>.BR ~/.cache/mc/mcedit/mcedit.clip ,
<a id='L90' name='L90'></a>and
<a id='L91' name='L91'></a>.B Ctrl\-Del
<a id='L92' name='L92'></a>deletes highlighted text.  Mouse highlighting also works on some
<a id='L93' name='L93'></a>terminals.  To use the standard mouse support provided by your terminal,
<a id='L94' name='L94'></a>hold the Shift key.  Please note that the mouse support in the terminal
<a id='L95' name='L95'></a>doesn't share the clipboard with
<a id='L96' name='L96'></a>.BR mcedit .
<a id='L97' name='L97'></a>.PP
<a id='L98' name='L98'></a>The completion key (usually
<a id='L99' name='L99'></a>.B "Meta\-Tab"
<a id='L100' name='L100'></a>or
<a id='L101' name='L101'></a>.BR "Escape Tab" )
<a id='L102' name='L102'></a>completes the word under the cursor using the words used in the file.
<a id='L103' name='L103'></a>.SH MACRO
<a id='L104' name='L104'></a>.PP
<a id='L105' name='L105'></a>To define a macro, press
<a id='L106' name='L106'></a>.B Ctrl\-R
<a id='L107' name='L107'></a>and then type out the keys you want to be executed.  Press
<a id='L108' name='L108'></a>.B Ctrl\-R
<a id='L109' name='L109'></a>again when finished.  The macro can be assigned to any key by pressing that key.
<a id='L110' name='L110'></a>The macro is executed when you press the assigned key.
<a id='L111' name='L111'></a>.PP
<a id='L112' name='L112'></a>The macro commands are stored in section
<a id='L113' name='L113'></a>.B [editor]
<a id='L114' name='L114'></a>it the file
<a id='L115' name='L115'></a>.BR ~/.local/share/mc/mc.macros .
<a id='L116' name='L116'></a>.PP
<a id='L117' name='L117'></a>External scripts (filters) can be assigned into the any hotkey by edit
<a id='L118' name='L118'></a>.B mc.macros
<a id='L119' name='L119'></a>like following:
<a id='L120' name='L120'></a>.PP
<a id='L121' name='L121'></a>.nf
<a id='L122' name='L122'></a>[editor]
<a id='L123' name='L123'></a>ctrl\-W=ExecuteScript:25;
<a id='L124' name='L124'></a>.fi
<a id='L125' name='L125'></a>.PP
<a id='L126' name='L126'></a>This means that ctrl\-W hotkey initiates the
<a id='L127' name='L127'></a>.I ExecuteScript(25)
<a id='L128' name='L128'></a>action, then editor handler translates this into execution of
<a id='L129' name='L129'></a>.B ~/.local/share/mc/mcedit/macros.d/macro.25.sh
<a id='L130' name='L130'></a>shell script.
<a id='L131' name='L131'></a>.PP
<a id='L132' name='L132'></a>External scripts are stored in
<a id='L133' name='L133'></a>.B ~/.local/share/mc/mcedit/macros.d/
<a id='L134' name='L134'></a>directory and must be named as
<a id='L135' name='L135'></a>.B macro.XXXX.sh
<a id='L136' name='L136'></a>where
<a id='L137' name='L137'></a>.B XXXX
<a id='L138' name='L138'></a>is the number from 0 to 9999.
<a id='L139' name='L139'></a>See
<a id='L140' name='L140'></a>.B Edit Menu File
<a id='L141' name='L141'></a>for more detail about format of the script.
<a id='L142' name='L142'></a>.PP
<a id='L143' name='L143'></a>Following macro definition and directives can be used:
<a id='L144' name='L144'></a>.TP
<a id='L145' name='L145'></a>.I #silent
<a id='L146' name='L146'></a>If this directive is set, then script starts without interactive subshell.
<a id='L147' name='L147'></a>.TP
<a id='L148' name='L148'></a>.I %c
<a id='L149' name='L149'></a>The cursor column position number.
<a id='L150' name='L150'></a>.TP
<a id='L151' name='L151'></a>.I %i
<a id='L152' name='L152'></a>The indent of blank space, equal the cursor column.
<a id='L153' name='L153'></a>.TP
<a id='L154' name='L154'></a>.I %y
<a id='L155' name='L155'></a>The syntax type of current file.
<a id='L156' name='L156'></a>.TP
<a id='L157' name='L157'></a>.I %b
<a id='L158' name='L158'></a>The block file name.
<a id='L159' name='L159'></a>.TP
<a id='L160' name='L160'></a>.I %f
<a id='L161' name='L161'></a>The current file name.
<a id='L162' name='L162'></a>.TP
<a id='L163' name='L163'></a>.I %n
<a id='L164' name='L164'></a>Only the current file name without extension.
<a id='L165' name='L165'></a>.TP
<a id='L166' name='L166'></a>.I %x
<a id='L167' name='L167'></a>The extension of current file name.
<a id='L168' name='L168'></a>.TP
<a id='L169' name='L169'></a>.I %d
<a id='L170' name='L170'></a>The current directory name.
<a id='L171' name='L171'></a>.TP
<a id='L172' name='L172'></a>.I %F
<a id='L173' name='L173'></a>The current file in the unselected panel.
<a id='L174' name='L174'></a>.TP
<a id='L175' name='L175'></a>.I %D
<a id='L176' name='L176'></a>The directory name of the unselected panel.
<a id='L177' name='L177'></a>.TP
<a id='L178' name='L178'></a>.I %t
<a id='L179' name='L179'></a>The currently tagged files.
<a id='L180' name='L180'></a>.TP
<a id='L181' name='L181'></a>.I %T
<a id='L182' name='L182'></a>The tagged files in the unselected panel.
<a id='L183' name='L183'></a>.TP
<a id='L184' name='L184'></a>.IR %u " and " %U
<a id='L185' name='L185'></a>Similar to the
<a id='L186' name='L186'></a>.I %t
<a id='L187' name='L187'></a>and
<a id='L188' name='L188'></a>.I %T
<a id='L189' name='L189'></a>macros, but in addition the files are untagged. You can use this macro
<a id='L190' name='L190'></a>only once per menu file entry or extension file entry, because next time
<a id='L191' name='L191'></a>there will be no tagged files.
<a id='L192' name='L192'></a>.TP
<a id='L193' name='L193'></a>.IR %s " and " %S
<a id='L194' name='L194'></a>The selected files: The tagged files if there are any. Otherwise the
<a id='L195' name='L195'></a>current file.
<a id='L196' name='L196'></a>.PP
<a id='L197' name='L197'></a>Feel free to edit this files, if you need.
<a id='L198' name='L198'></a>Here is a sample external script:
<a id='L199' name='L199'></a>.PP
<a id='L200' name='L200'></a>.nf
<a id='L201' name='L201'></a>l       comment selection
<a id='L202' name='L202'></a>        TMPFILE=`mktemp ${MC_TMPDIR:\-/tmp}/up.XXXXXX` || exit 1
<a id='L203' name='L203'></a>        echo #if 0 &gt; $TMPFILE
<a id='L204' name='L204'></a>        cat %b &gt;&gt; $TMPFILE
<a id='L205' name='L205'></a>        echo #endif &gt;&gt; $TMPFILE
<a id='L206' name='L206'></a>        cat $TMPFILE &gt; %b
<a id='L207' name='L207'></a>        rm \-f $TMPFILE
<a id='L208' name='L208'></a>.fi
<a id='L209' name='L209'></a>.PP
<a id='L210' name='L210'></a>If some keys don't work, you can use
<a id='L211' name='L211'></a>.B Learn Keys
<a id='L212' name='L212'></a>in the
<a id='L213' name='L213'></a>.B Options
<a id='L214' name='L214'></a>menu.
<a id='L215' name='L215'></a>.SH CODE NAVIGATION
<a id='L216' name='L216'></a>.B mcedit
<a id='L217' name='L217'></a>can be used for navigation through code with tags files created by etags
<a id='L218' name='L218'></a>or ctags commands. If there is no TAGS file code navigation will not work.
<a id='L219' name='L219'></a>For example, in case of exuberant\-ctags for C language command will be:
<a id='L220' name='L220'></a>.PP
<a id='L221' name='L221'></a>ctags \-e \-\-language\-force=C \-R ./
<a id='L222' name='L222'></a>.PP
<a id='L223' name='L223'></a>.B Meta\-Enter
<a id='L224' name='L224'></a>shows list box to select item under cursor (cursor should stand at the end
<a id='L225' name='L225'></a>of the word).
<a id='L226' name='L226'></a>.PP
<a id='L227' name='L227'></a>.B Meta\-Minus
<a id='L228' name='L228'></a>where minus is symbol "\-" goes to previous function in navigation list
<a id='L229' name='L229'></a>(like browser's Back button).
<a id='L230' name='L230'></a>.PP
<a id='L231' name='L231'></a>.B Meta\-Equal
<a id='L232' name='L232'></a>where equal is symbol "=" goes to next function in navigation list
<a id='L233' name='L233'></a>(like browser's Forward button).
<a id='L234' name='L234'></a>.PP
<a id='L235' name='L235'></a>.SH SYNTAX HIGHLIGHTING
<a id='L236' name='L236'></a>.B mcedit
<a id='L237' name='L237'></a>supports syntax highlighting.  This means that keywords and contexts
<a id='L238' name='L238'></a>(like C comments, string constants, etc) are highlighted in different
<a id='L239' name='L239'></a>colors.  The following section explains the format of the file
<a id='L240' name='L240'></a>.BR ~/.config/mc/mcedit/Syntax .
<a id='L241' name='L241'></a>If this file is missing, system\-wide
<a id='L242' name='L242'></a>.B %prefix%/share/mc/syntax/Syntax
<a id='L243' name='L243'></a>is used.
<a id='L244' name='L244'></a>The file
<a id='L245' name='L245'></a>.B ~/.config/mc/mcedit/Syntax
<a id='L246' name='L246'></a>is rescanned on opening of every new editor file.  The file contains
<a id='L247' name='L247'></a>rules for highlighting, each of which is given on a separate line, and
<a id='L248' name='L248'></a>define which keywords will be highlighted with what color.
<a id='L249' name='L249'></a>.PP
<a id='L250' name='L250'></a>The file is divided into sections, each beginning with a line with the
<a id='L251' name='L251'></a>.B file
<a id='L252' name='L252'></a>command.  The sections are normally put into separate files using the
<a id='L253' name='L253'></a>.B include
<a id='L254' name='L254'></a>command.
<a id='L255' name='L255'></a>.PP
<a id='L256' name='L256'></a>The
<a id='L257' name='L257'></a>.B file
<a id='L258' name='L258'></a>command has three arguments.  The first argument is a regular expression
<a id='L259' name='L259'></a>that is applied to the file name to determine if the following section
<a id='L260' name='L260'></a>applies to the file.  The second argument is the description of the file
<a id='L261' name='L261'></a>type.  It is used in
<a id='L262' name='L262'></a>.BR cooledit ;
<a id='L263' name='L263'></a>future versions of
<a id='L264' name='L264'></a>.B mcedit
<a id='L265' name='L265'></a>may use it as well.  The third optional argument is a regular expression
<a id='L266' name='L266'></a>to match the first line of text of the file.  The rules in the following
<a id='L267' name='L267'></a>section apply if either the file name or the first line of text matches.
<a id='L268' name='L268'></a>.PP
<a id='L269' name='L269'></a>A section ends with the start of another section.  Each section is
<a id='L270' name='L270'></a>divided into contexts, and each context contains rules.  A context is a
<a id='L271' name='L271'></a>scope within the text that a particular set of rules belongs to.  For
<a id='L272' name='L272'></a>instance, the text within a C style comment (i.e. between
<a id='L273' name='L273'></a>.B /*
<a id='L274' name='L274'></a>and
<a id='L275' name='L275'></a>.BR */ )
<a id='L276' name='L276'></a>has its own color.  This is a context, although it has no further rules
<a id='L277' name='L277'></a>inside it because there is probably nothing that we want highlighted
<a id='L278' name='L278'></a>within a C comment.
<a id='L279' name='L279'></a>.PP
<a id='L280' name='L280'></a>A trivial C programming section might look like this:
<a id='L281' name='L281'></a>.PP
<a id='L282' name='L282'></a>.nf
<a id='L283' name='L283'></a>file .\\*\\\\.c C\\sProgram\\sFile (#include|/\\\\\\*)
<a id='L284' name='L284'></a> 
<a id='L285' name='L285'></a>wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_
<a id='L286' name='L286'></a> 
<a id='L287' name='L287'></a># default colors
<a id='L288' name='L288'></a>define  comment   brown
<a id='L289' name='L289'></a>context default
<a id='L290' name='L290'></a>  keyword  whole  if       yellow
<a id='L291' name='L291'></a>  keyword  whole  else     yellow
<a id='L292' name='L292'></a>  keyword  whole  for      yellow
<a id='L293' name='L293'></a>  keyword  whole  while    yellow
<a id='L294' name='L294'></a>  keyword  whole  do       yellow
<a id='L295' name='L295'></a>  keyword  whole  switch   yellow
<a id='L296' name='L296'></a>  keyword  whole  case     yellow
<a id='L297' name='L297'></a>  keyword  whole  static   yellow
<a id='L298' name='L298'></a>  keyword  whole  extern   yellow
<a id='L299' name='L299'></a>  keyword         {        brightcyan
<a id='L300' name='L300'></a>  keyword         }        brightcyan
<a id='L301' name='L301'></a>  keyword         '*'      green
<a id='L302' name='L302'></a> 
<a id='L303' name='L303'></a># C comments
<a id='L304' name='L304'></a>context /\\* \\*/ comment
<a id='L305' name='L305'></a> 
<a id='L306' name='L306'></a># C preprocessor directives
<a id='L307' name='L307'></a>context linestart # \\n red
<a id='L308' name='L308'></a>  keyword  \\\\\\n  brightred
<a id='L309' name='L309'></a> 
<a id='L310' name='L310'></a># C string constants
<a id='L311' name='L311'></a>context " " green
<a id='L312' name='L312'></a>  keyword  %d    brightgreen
<a id='L313' name='L313'></a>  keyword  %s    brightgreen
<a id='L314' name='L314'></a>  keyword  %c    brightgreen
<a id='L315' name='L315'></a>  keyword  \\\\"   brightgreen
<a id='L316' name='L316'></a>.fi
<a id='L317' name='L317'></a>.PP
<a id='L318' name='L318'></a>Each context starts with a line of the form:
<a id='L319' name='L319'></a>.PP
<a id='L320' name='L320'></a>.B context
<a id='L321' name='L321'></a>.RB [ exclusive ]
<a id='L322' name='L322'></a>.RB [ whole | wholeright | wholeleft ]
<a id='L323' name='L323'></a>.RB [ linestart ]
<a id='L324' name='L324'></a>.I delim
<a id='L325' name='L325'></a>.RB [ linestart ]
<a id='L326' name='L326'></a>.I delim
<a id='L327' name='L327'></a>.RI [ foreground ]
<a id='L328' name='L328'></a>.RI [ background ]
<a id='L329' name='L329'></a>.RI [ attributes ]
<a id='L330' name='L330'></a>.PP
<a id='L331' name='L331'></a>The first context is an exception.  It must start with the command
<a id='L332' name='L332'></a>.PP
<a id='L333' name='L333'></a>.B context default
<a id='L334' name='L334'></a>.RI [ foreground ]
<a id='L335' name='L335'></a>.RI [ background ]
<a id='L336' name='L336'></a>.RI [ attributes ]
<a id='L337' name='L337'></a>.PP
<a id='L338' name='L338'></a>otherwise
<a id='L339' name='L339'></a>.B mcedit
<a id='L340' name='L340'></a>will report an error.  The
<a id='L341' name='L341'></a>.B linestart
<a id='L342' name='L342'></a>option specifies that
<a id='L343' name='L343'></a>.I delim
<a id='L344' name='L344'></a>must start at the beginning of a line.  The
<a id='L345' name='L345'></a>.B whole
<a id='L346' name='L346'></a>option tells that
<a id='L347' name='L347'></a>.I delim
<a id='L348' name='L348'></a>must be a whole word.  To specify that a word must begin on the word
<a id='L349' name='L349'></a>boundary only on the left side, you can use the
<a id='L350' name='L350'></a>.B wholeleft
<a id='L351' name='L351'></a>option, and similarly a word that must end on the word boundary is specified by
<a id='L352' name='L352'></a>.BR wholeright .
<a id='L353' name='L353'></a>.PP
<a id='L354' name='L354'></a>The set of characters that constitute a whole word can be changed at any
<a id='L355' name='L355'></a>point in the file with the
<a id='L356' name='L356'></a>.B wholechars
<a id='L357' name='L357'></a>command.  The left and right set of characters can be set separately
<a id='L358' name='L358'></a>with
<a id='L359' name='L359'></a>.PP
<a id='L360' name='L360'></a>.B wholechars
<a id='L361' name='L361'></a>.RB [ left | right ]
<a id='L362' name='L362'></a>.I characters
<a id='L363' name='L363'></a>.PP
<a id='L364' name='L364'></a>The
<a id='L365' name='L365'></a>.B exclusive
<a id='L366' name='L366'></a>option causes the text between the delimiters to be highlighted, but not
<a id='L367' name='L367'></a>the delimiters themselves.
<a id='L368' name='L368'></a>.PP
<a id='L369' name='L369'></a>Each rule is a line of the form:
<a id='L370' name='L370'></a>.PP
<a id='L371' name='L371'></a>.B keyword
<a id='L372' name='L372'></a>.RB [ whole | wholeright | wholeleft ]
<a id='L373' name='L373'></a>.RB [ linestart ]
<a id='L374' name='L374'></a>.I string foreground
<a id='L375' name='L375'></a>.RI [ background ]
<a id='L376' name='L376'></a>.RI [ attributes ]
<a id='L377' name='L377'></a>.PP
<a id='L378' name='L378'></a>Context or keyword strings are interpreted, so that you can include tabs
<a id='L379' name='L379'></a>and spaces with the sequences \\t and \\s.  Newlines and backslashes are
<a id='L380' name='L380'></a>specified with \\n and \\\\ respectively.  Since whitespace is used as a
<a id='L381' name='L381'></a>separator, it may not be used as is.  Also, \\* must be used to specify
<a id='L382' name='L382'></a>an asterisk.  The * itself is a wildcard that matches any length of
<a id='L383' name='L383'></a>characters.  For example,
<a id='L384' name='L384'></a>.PP
<a id='L385' name='L385'></a>.nf
<a id='L386' name='L386'></a>  keyword         '*'      green
<a id='L387' name='L387'></a>.fi
<a id='L388' name='L388'></a>.PP
<a id='L389' name='L389'></a>colors all C single character constants green.  You also could use
<a id='L390' name='L390'></a>.PP
<a id='L391' name='L391'></a>.nf
<a id='L392' name='L392'></a>  keyword         "*"      green
<a id='L393' name='L393'></a>.fi
<a id='L394' name='L394'></a>.PP
<a id='L395' name='L395'></a>to color string constants, but the matched string would not be allowed
<a id='L396' name='L396'></a>to span across multiple newlines.  The wildcard may be used within
<a id='L397' name='L397'></a>context delimiters as well, but you cannot have a wildcard as the last
<a id='L398' name='L398'></a>or first character.
<a id='L399' name='L399'></a>.PP
<a id='L400' name='L400'></a>Important to note is the line
<a id='L401' name='L401'></a>.PP
<a id='L402' name='L402'></a>.nf
<a id='L403' name='L403'></a>  keyword  \\\\\\n  brightgreen
<a id='L404' name='L404'></a>.fi
<a id='L405' name='L405'></a>.PP
<a id='L406' name='L406'></a>This line defines a keyword containing the backslash and newline
<a id='L407' name='L407'></a>characters.  Since the keywords are matched before the context
<a id='L408' name='L408'></a>delimiters, this keyword prevents the context from ending at the end of
<a id='L409' name='L409'></a>the lines that end in a backslash, thus allowing C preprocessor
<a id='L410' name='L410'></a>directive to continue across multiple lines.
<a id='L411' name='L411'></a>.PP
<a id='L412' name='L412'></a>The possible colors are: black, gray, red, brightred, green,
<a id='L413' name='L413'></a>brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta,
<a id='L414' name='L414'></a>cyan, brightcyan, lightgray and white. The special keyword "default" means
<a id='L415' name='L415'></a>the terminal's default. Another special keyword "base" means mc's main
<a id='L416' name='L416'></a>colors, it is useful as a placeholder if you want to specify attributes
<a id='L417' name='L417'></a>without modifying the background color. When 256 colors are available,
<a id='L418' name='L418'></a>they can be specified either as color16 to color255, or as rgb000 to rgb555
<a id='L419' name='L419'></a>and gray0 to gray23.
<a id='L420' name='L420'></a>.PP
<a id='L421' name='L421'></a>If the syntax file is shared with
<a id='L422' name='L422'></a>.BR cooledit ,
<a id='L423' name='L423'></a>it is possible to specify different colors for
<a id='L424' name='L424'></a>.B mcedit
<a id='L425' name='L425'></a>and
<a id='L426' name='L426'></a>.B cooledit
<a id='L427' name='L427'></a>by separating them with a slash, e.g.
<a id='L428' name='L428'></a>.PP
<a id='L429' name='L429'></a>.nf
<a id='L430' name='L430'></a>keyword  #include  red/Orange
<a id='L431' name='L431'></a>.fi
<a id='L432' name='L432'></a>.PP
<a id='L433' name='L433'></a>.B mcedit
<a id='L434' name='L434'></a>uses the color before the slash.  See cooledit(1) for supported
<a id='L435' name='L435'></a>.B cooledit
<a id='L436' name='L436'></a>colors.
<a id='L437' name='L437'></a>.PP
<a id='L438' name='L438'></a>Attributes can be any of bold, italic, underline, reverse and blink, appended by a
<a id='L439' name='L439'></a>plus sign if more than one are desired.
<a id='L440' name='L440'></a>.PP
<a id='L441' name='L441'></a>Comments may be put on a separate line starting with the hash sign (#).
<a id='L442' name='L442'></a>.PP
<a id='L443' name='L443'></a>If you are describing case insensitive language you need to use
<a id='L444' name='L444'></a>.B caseinsensitive
<a id='L445' name='L445'></a>directive. It should be specified at the beginning of syntax file.
<a id='L446' name='L446'></a>.PP
<a id='L447' name='L447'></a>Because of the simplicity of the implementation, there are a few
<a id='L448' name='L448'></a>intricacies that will not be dealt with correctly but these are a minor
<a id='L449' name='L449'></a>irritation.  On the whole, a broad spectrum of quite complicated
<a id='L450' name='L450'></a>situations are handled with these simple rules.  It is a good idea to
<a id='L451' name='L451'></a>take a look at the syntax file to see some of the nifty tricks you can
<a id='L452' name='L452'></a>do with a little imagination.  If you cannot get by with the rules I
<a id='L453' name='L453'></a>have coded, and you think you have a rule that would be useful, please
<a id='L454' name='L454'></a>email me with your request.  However, do not ask for regular expression
<a id='L455' name='L455'></a>support, because this is flatly impossible.
<a id='L456' name='L456'></a>.PP
<a id='L457' name='L457'></a>A useful hint is to work with as much as possible with the things you
<a id='L458' name='L458'></a>can do rather than try to do things that this implementation cannot deal
<a id='L459' name='L459'></a>with.  Also remember that the aim of syntax highlighting is to make
<a id='L460' name='L460'></a>programming less prone to error, not to make code look pretty.
<a id='L461' name='L461'></a>.PP
<a id='L462' name='L462'></a>The syntax highlighting can be toggled using Ctrl\-s shortcut.
<a id='L463' name='L463'></a>.SH COLORS
<a id='L464' name='L464'></a>The default colors may be changed by appending to the
<a id='L465' name='L465'></a>.B MC_COLOR_TABLE
<a id='L466' name='L466'></a>environment variable.  Foreground and background colors pairs may be
<a id='L467' name='L467'></a>specified for example with:
<a id='L468' name='L468'></a>.PP
<a id='L469' name='L469'></a>.nf
<a id='L470' name='L470'></a>MC_COLOR_TABLE="$MC_COLOR_TABLE:\\
<a id='L471' name='L471'></a>editnormal=lightgray,black:\\
<a id='L472' name='L472'></a>editbold=yellow,black:\\
<a id='L473' name='L473'></a>editmarked=black,cyan"
<a id='L474' name='L474'></a>.fi
<a id='L475' name='L475'></a>.SH OPTIONS
<a id='L476' name='L476'></a>Most options can be set from Options dialog box.  See the
<a id='L477' name='L477'></a>.B Options
<a id='L478' name='L478'></a>menu.  The following options are defined in
<a id='L479' name='L479'></a>.B ~/.config/mc/ini
<a id='L480' name='L480'></a>and have obvious counterparts in the dialog box.  You can modify them to
<a id='L481' name='L481'></a>change the editor behavior, by editing the file.  Unless specified, a 1
<a id='L482' name='L482'></a>sets the option to on, and a 0 sets it to off, as usual.
<a id='L483' name='L483'></a>.TP
<a id='L484' name='L484'></a>.I use_internal_edit
<a id='L485' name='L485'></a>This option is ignored when invoking
<a id='L486' name='L486'></a>.BR mcedit .
<a id='L487' name='L487'></a>.TP
<a id='L488' name='L488'></a>.I editor_tab_spacing
<a id='L489' name='L489'></a>Interpret the tab character as being of this length.
<a id='L490' name='L490'></a>Default is 8. You should avoid using
<a id='L491' name='L491'></a>other than 8 since most other editors and text viewers
<a id='L492' name='L492'></a>assume a tab spacing of 8. Use
<a id='L493' name='L493'></a>.B editor_fake_half_tabs
<a id='L494' name='L494'></a>to simulate a smaller tab spacing.
<a id='L495' name='L495'></a>.TP
<a id='L496' name='L496'></a>.I editor_fill_tabs_with_spaces
<a id='L497' name='L497'></a>Never insert a tab character. Rather insert spaces (ascii 32) to fill to the
<a id='L498' name='L498'></a>desired tab size.
<a id='L499' name='L499'></a>.TP
<a id='L500' name='L500'></a>.I editor_return_does_auto_indent
<a id='L501' name='L501'></a>Pressing return will tab across to match the indentation
<a id='L502' name='L502'></a>of the first line above that has text on it.
<a id='L503' name='L503'></a>.TP
<a id='L504' name='L504'></a>.I editor_backspace_through_tabs
<a id='L505' name='L505'></a>Make a single backspace delete all the space to the left
<a id='L506' name='L506'></a>margin if there is no text between the cursor and the left
<a id='L507' name='L507'></a>margin.
<a id='L508' name='L508'></a>.TP
<a id='L509' name='L509'></a>.I editor_fake_half_tabs
<a id='L510' name='L510'></a>This will emulate a half tab for those who want to program
<a id='L511' name='L511'></a>with a tab spacing of 4, but do not want the tab size changed
<a id='L512' name='L512'></a>from 8 (so that the code will be formatted the same when displayed
<a id='L513' name='L513'></a>by other programs). When editing between text and the left
<a id='L514' name='L514'></a>margin, moving and tabbing will be as though a tab space were
<a id='L515' name='L515'></a>4, while actually using spaces and normal tabs for an optimal fill.
<a id='L516' name='L516'></a>When editing anywhere else, a normal tab is inserted.
<a id='L517' name='L517'></a>.TP
<a id='L518' name='L518'></a>.I editor_option_save_mode
<a id='L519' name='L519'></a>Possible values 0, 1 and 2.  The save mode (see the options menu also)
<a id='L520' name='L520'></a>allows you to change the method of saving a file.  Quick save (0) saves
<a id='L521' name='L521'></a>the file immediately, truncating the disk file to zero length (i.e.
<a id='L522' name='L522'></a>erasing it) and then writing the editor contents to the file.  This
<a id='L523' name='L523'></a>method is fast, but dangerous, since a system error during a file save
<a id='L524' name='L524'></a>will leave the file only partially written, possibly rendering the data
<a id='L525' name='L525'></a>irretrievable.  When saving, the safe save (1) option enables creation
<a id='L526' name='L526'></a>of a temporary file into which the file contents are first written.  In
<a id='L527' name='L527'></a>the event of a problem, the original file is untouched.  When the
<a id='L528' name='L528'></a>temporary file is successfully written, it is renamed to the name of the
<a id='L529' name='L529'></a>original file, thus replacing it.  The safest method is create backups
<a id='L530' name='L530'></a>(2): a backup file is created before any changes are made.  You
<a id='L531' name='L531'></a>can specify your own backup file extension in the dialog.  Note that
<a id='L532' name='L532'></a>saving twice will replace your backup as well as your original file.
<a id='L533' name='L533'></a>.TP
<a id='L534' name='L534'></a>.I editor_word_wrap_line_length
<a id='L535' name='L535'></a>Line length to wrap at. Default is 72.
<a id='L536' name='L536'></a>.TP
<a id='L537' name='L537'></a>.I editor_backup_extension
<a id='L538' name='L538'></a>Symbol to add to name of backup files. Default is "~".
<a id='L539' name='L539'></a>.TP
<a id='L540' name='L540'></a>.I editor_line_state
<a id='L541' name='L541'></a>Show state line of editor. Currently it shows current line number (in the future
<a id='L542' name='L542'></a>it might show things like folding, breakpoints, etc.). M\-n toggles this option.
<a id='L543' name='L543'></a>.TP
<a id='L544' name='L544'></a>.I editor_visible_spaces
<a id='L545' name='L545'></a>Toggle "show visible trailing spaces".  If editor_visible_spaces=1, they are shown
<a id='L546' name='L546'></a>as '.'
<a id='L547' name='L547'></a>.TP
<a id='L548' name='L548'></a>.I editor_visible_tabs
<a id='L549' name='L549'></a>Toggle "show visible tabs".  If editor_visible_tabs=1, tabs are shown as '&lt;\-\-\-\-&gt;'
<a id='L550' name='L550'></a>.TP
<a id='L551' name='L551'></a>.I editor_persistent_selections
<a id='L552' name='L552'></a>Do not remove block selection after cursor movement.
<a id='L553' name='L553'></a>.TP
<a id='L554' name='L554'></a>.I editor_drop_selection_on_copy
<a id='L555' name='L555'></a>Reset selection after copy to clipboard.
<a id='L556' name='L556'></a>.TP
<a id='L557' name='L557'></a>.I editor_cursor_beyond_eol
<a id='L558' name='L558'></a>Allow moving cursor beyond the end of line.
<a id='L559' name='L559'></a>.TP
<a id='L560' name='L560'></a>.I editor_cursor_after_inserted_block
<a id='L561' name='L561'></a>Allow moving cursor after inserted block.
<a id='L562' name='L562'></a>.TP
<a id='L563' name='L563'></a>.I editor_syntax_highlighting
<a id='L564' name='L564'></a>enable syntax highlighting.
<a id='L565' name='L565'></a>.TP
<a id='L566' name='L566'></a>.I editor_edit_confirm_save
<a id='L567' name='L567'></a>Show confirmation dialog on save.
<a id='L568' name='L568'></a>.TP
<a id='L569' name='L569'></a>.I editor_option_typewriter_wrap
<a id='L570' name='L570'></a>to be described
<a id='L571' name='L571'></a>.TP
<a id='L572' name='L572'></a>.I editor_option_auto_para_formatting
<a id='L573' name='L573'></a>to be described
<a id='L574' name='L574'></a>.TP
<a id='L575' name='L575'></a>.I editor_option_save_position
<a id='L576' name='L576'></a>Save file position on exit.
<a id='L577' name='L577'></a>.TP
<a id='L578' name='L578'></a>.I source_codepage
<a id='L579' name='L579'></a>Symbol representation of codepage name for file (i.e. CP1251, ~ \- default).
<a id='L580' name='L580'></a>.TP
<a id='L581' name='L581'></a>.I editor_group_undo
<a id='L582' name='L582'></a>Combine UNDO actions for several of the same type of action (inserting/overwriting,
<a id='L583' name='L583'></a>deleting, navigating, typing)
<a id='L584' name='L584'></a>.TP
<a id='L585' name='L585'></a>.I editor_wordcompletion_collect_entire_file
<a id='L586' name='L586'></a>Search autocomplete candidates in entire file (1) or just from
<a id='L587' name='L587'></a>beginning of file to cursor position (0).
<a id='L588' name='L588'></a>.TP
<a id='L589' name='L589'></a>.I spell_language
<a id='L590' name='L590'></a>Spelling language (en, en\-variant_0, ru, etc) installed with aspell
<a id='L591' name='L591'></a>package (a full list can be obtained using 'aspell' utility).
<a id='L592' name='L592'></a>Use
<a id='L593' name='L593'></a>.B spell_language = NONE
<a id='L594' name='L594'></a>to disable aspell support. Default value is 'en'. Option must be located
<a id='L595' name='L595'></a>in the [Misc] section.
<a id='L596' name='L596'></a>.TP
<a id='L597' name='L597'></a>.I editor_stop_format_chars
<a id='L598' name='L598'></a>Set of characters to stop paragraph formatting. If one of those characters
<a id='L599' name='L599'></a>is found in the beginning of line, that line and all following lines of paragraph
<a id='L600' name='L600'></a>will be untouched. Default value is
<a id='L601' name='L601'></a>"\fB-\fR\fB+\fR\fB*\fR\fB\\\fR\fB,\fR\fB.\fR\fB;\fR\fB:\fR\fB&amp;\fR\fB&gt;\fR".
<a id='L602' name='L602'></a>.TP
<a id='L603' name='L603'></a>.I editor_state_full_filename
<a id='L604' name='L604'></a>Show full path name in the status line. If disabled (default), only base name of the
<a id='L605' name='L605'></a>file is shown.
<a id='L606' name='L606'></a>.SH MISCELLANEOUS
<a id='L607' name='L607'></a>The editor also displays non\-us characters (160+).  When editing
<a id='L608' name='L608'></a>binary files, you should set
<a id='L609' name='L609'></a>.B display bits
<a id='L610' name='L610'></a>to 7 bits in Midnight Commander's options menu to keep the spacing
<a id='L611' name='L611'></a>clean.
<a id='L612' name='L612'></a>.SH FILES
<a id='L613' name='L613'></a>.I %prefix%/share/mc/help/mc.hlp
<a id='L614' name='L614'></a>.IP
<a id='L615' name='L615'></a>The help file for the program.
<a id='L616' name='L616'></a>.PP
<a id='L617' name='L617'></a>.I %prefix%/share/mc/mc.ini
<a id='L618' name='L618'></a>.IP
<a id='L619' name='L619'></a>The default system\-wide setup for GNU Midnight Commander, used only if
<a id='L620' name='L620'></a>the user's own ~/.config/mc/ini file is missing.
<a id='L621' name='L621'></a>.PP
<a id='L622' name='L622'></a>.I %prefix%/share/mc/mc.lib
<a id='L623' name='L623'></a>.IP
<a id='L624' name='L624'></a>Global settings for Midnight Commander. Settings in this file
<a id='L625' name='L625'></a>affect all users, whether they have ~/.config/mc/ini or not.
<a id='L626' name='L626'></a>.PP
<a id='L627' name='L627'></a>.I %prefix%/share/mc/syntax/*
<a id='L628' name='L628'></a>.IP
<a id='L629' name='L629'></a>The default system\-wide syntax files for mcedit, used only if
<a id='L630' name='L630'></a>the corresponding user's own ~/.local/share/mc/mcedit/ file is missing.
<a id='L631' name='L631'></a>.PP
<a id='L632' name='L632'></a>.I ~/.config/mc/ini
<a id='L633' name='L633'></a>.IP
<a id='L634' name='L634'></a>User's own setup.  If this file is present then the setup is loaded
<a id='L635' name='L635'></a>from here instead of the system\-wide setup file.
<a id='L636' name='L636'></a>.PP
<a id='L637' name='L637'></a>.I ~/.local/share/mc/mcedit/
<a id='L638' name='L638'></a>.IP
<a id='L639' name='L639'></a>User's own directory where block commands are processed and saved and
<a id='L640' name='L640'></a>user's own syntax files are located.
<a id='L641' name='L641'></a>.SH LICENSE
<a id='L642' name='L642'></a>This program is distributed under the terms of the GNU General Public
<a id='L643' name='L643'></a>License as published by the Free Software Foundation.  See the built\-in
<a id='L644' name='L644'></a>help of Midnight Commander for details on the License and the lack
<a id='L645' name='L645'></a>of warranty.
<a id='L646' name='L646'></a>.SH AVAILABILITY
<a id='L647' name='L647'></a>The latest version of this program can be found at
<a id='L648' name='L648'></a>http://ftp.midnight\-commander.org/.
<a id='L649' name='L649'></a>.SH SEE ALSO
<a id='L650' name='L650'></a>cooledit(1), mc(1), gpm(1), terminfo(1), scanf(3).
<a id='L651' name='L651'></a>.SH AUTHORS
<a id='L652' name='L652'></a>Paul Sheer (psheer@obsidian.co.za) is the original author of
<a id='L653' name='L653'></a>Midnight Commander's internal editor.
<a id='L654' name='L654'></a>.SH BUGS
<a id='L655' name='L655'></a>Bugs should be reported to http://www.midnight\-commander.org/.
</pre>
<hr />
<a id='BOTTOM' name='BOTTOM'></a>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><img class='icon' src='../icons/n_first.png' alt='[first]' /><img class='icon' src='../icons/n_last.png' alt='[last]' /><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a><img class='icon' src='../icons/n_bottom.png' alt='[bottom]' /><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+655 doc/man/mcedit.1.in'  /> */</em>
</body>
</html>
